import { RouterProvider } from 'react-router-dom'
import router from './router'
import './App.less'
import '@/styles/index.less'
import { ConfigProvider, theme } from 'antd'
import zhCN from 'antd/es/locale/zh_CN' // 引入中文包
import { useAppStore } from './store/app'

function App() {
  const { theme: themeType } = useAppStore()
  return (
    <ConfigProvider
      locale={zhCN}
      theme={{
        algorithm: themeType === 'light' ? theme.defaultAlgorithm : theme.darkAlgorithm
      }}
    >
      <RouterProvider router={router}></RouterProvider>
    </ConfigProvider>
  )
}

export default App
